
/**********
Code to generate the findings presented in the manuscript "Empowerment through education and entrepreneurship: feasibility and preliminary effectiveness evidence from indigenous adolescents in Ecuador "
Date last revised: 6 June 2025; 26 Sep 2024; 16 Oct 24; 24 Feb 25
Author: Marta Wilson
**********/

clear all
capture log close
macro drop _all
set more off, permanently
set linesize 255

ssc install carryforward 
ssc install distinct

//set global directories 
pwd
global folder "Z:\Omar Projects\Ecuador Research and Manuscripts\PSTC Seed Funds 2023\Final Datasets and Codebooks"
global sourcedir "$folder\Clean Data"
global outputdir "$folder\Output"

log using "$outputdir/EcuadorPilot.log", replace

//change directory to source folder
cd "$sourcedir"	
pwd

********************************

***Read in the data 
use "$sourcedir\Ecuador School Survey_Merged.dta", clear

describe // 49 observations, 143 variables

sum SHK1_O1 SHK1_O2 SHK1_O3 SHK1_O4 SHK1_O5 SHK2 SHK3 SHK4 SHK5 SHK6 SHK7 SHK8

codebook SHK1_O1 SHK1_O2 SHK1_O3 SHK1_O4 SHK1_O5 SHK2 SHK3 SHK4 SHK5 SHK6 SHK7 SHK8

list ID if SHK1_O1==-1

***this is panel data currently in wide format, and we want to reshape to long format

*rename the month 4 variables 
rename (S_M4DEMO3_6 S_M4DEMO15_8) (M4S_DEMO3_6 M4S_DEMO15_8)

local vars "M4DATE M4DEMO1 M4Q_2_S M4DEMO2 M4DEMO3_O1 M4DEMO3_O2 M4DEMO3_O3 M4DEMO3_O4 M4DEMO3_O5 M4DEMO3_O6 M4S_DEMO3_6 M4DEMO4 M4DEMO5 M4DEMO6 M4Q_7_S M4DEMO7 M4DEMO8 M4DEMO9 M4DEMO10 M4DEMO11 M4DEMO12 M4DEMO13 M4DEMO14 M4DEMO15_O1 M4DEMO15_O2 M4DEMO15_O3 M4DEMO15_O4 M4DEMO15_O5 M4DEMO15_O6 M4DEMO15_O7 M4DEMO15_O8 M4S_DEMO15_8 M4SHK1_O1 M4SHK1_O2 M4SHK1_O3 M4SHK1_O4 M4SHK1_O5 M4SHK2 M4SHK3 M4SHK4 M4SHK5 M4SHK6 M4SHK7 M4SHK8 M4GEI1 M4GEI2 M4GEI3 M4GEI4 M4GEI5 M4ESE1 M4ESE2 M4ESE3 M4ESE4 M4ESE5 M4ESE6 M4ESE7 M4ESE8 M4ESE9 M4ESE10 M4ESE11 M4ESE12 M4FL1 M4FL2 M4FL3 M4FL4 M4FL5 M4IGAI1 M4IGAI2 M4IGAI3 M4IGAI4 M4IGAI5"
foreach k of local vars {
    rename `k' `k'_M4
}

local vars "M4DATE_M4 M4DEMO1_M4 M4Q_2_S_M4 M4DEMO2_M4 M4DEMO3_O1_M4 M4DEMO3_O2_M4 M4DEMO3_O3_M4 M4DEMO3_O4_M4 M4DEMO3_O5_M4 M4DEMO3_O6_M4 M4S_DEMO3_6_M4 M4DEMO4_M4 M4DEMO5_M4 M4DEMO6_M4 M4Q_7_S_M4 M4DEMO7_M4 M4DEMO8_M4 M4DEMO9_M4 M4DEMO10_M4 M4DEMO11_M4 M4DEMO12_M4 M4DEMO13_M4 M4DEMO14_M4 M4DEMO15_O1_M4 M4DEMO15_O2_M4 M4DEMO15_O3_M4 M4DEMO15_O4_M4 M4DEMO15_O5_M4 M4DEMO15_O6_M4 M4DEMO15_O7_M4 M4DEMO15_O8_M4 M4S_DEMO15_8_M4 M4SHK1_O1_M4 M4SHK1_O2_M4 M4SHK1_O3_M4 M4SHK1_O4_M4 M4SHK1_O5_M4 M4SHK2_M4 M4SHK3_M4 M4SHK4_M4 M4SHK5_M4 M4SHK6_M4 M4SHK7_M4 M4SHK8_M4 M4GEI1_M4 M4GEI2_M4 M4GEI3_M4 M4GEI4_M4 M4GEI5_M4 M4ESE1_M4 M4ESE2_M4 M4ESE3_M4 M4ESE4_M4 M4ESE5_M4 M4ESE6_M4 M4ESE7_M4 M4ESE8_M4 M4ESE9_M4 M4ESE10_M4 M4ESE11_M4 M4ESE12_M4 M4FL1_M4 M4FL2_M4 M4FL3_M4 M4FL4_M4 M4FL5_M4 M4IGAI1_M4 M4IGAI2_M4 M4IGAI3_M4 M4IGAI4_M4 M4IGAI5_M4"
foreach k of local vars {
    local rest = substr("`k'", 3, .)
    rename `k' `rest'
}	

*rename the month 0 variables 
rename Date DATE
local vars "DATE DEMO1 Q_2_S DEMO2 DEMO3_O1 DEMO3_O2 DEMO3_O3 DEMO3_O4 DEMO3_O5 DEMO3_O6 S_DEMO3_6 DEMO4 DEMO5 DEMO6 Q_7_S DEMO7 DEMO8 DEMO9 DEMO10 DEMO11 DEMO12 DEMO13 DEMO14 DEMO15_O1 DEMO15_O2 DEMO15_O3 DEMO15_O4 DEMO15_O5 DEMO15_O6 DEMO15_O7 DEMO15_O8 S_DEMO15_8 SHK1_O1 SHK1_O2 SHK1_O3 SHK1_O4 SHK1_O5 SHK2 SHK3 SHK4 SHK5 SHK6 SHK7 SHK8 GEI1 GEI2 GEI3 GEI4 GEI5 ESE1 ESE2 ESE3 ESE4 ESE5 ESE6 ESE7 ESE8 ESE9 ESE10 ESE11 ESE12 FL1 FL2 FL3 FL4 FL5 IGAI1 IGAI2 IGAI3 IGAI4 IGAI5"
foreach k of local vars {
    rename `k' `k'_M0
}

*reshape wide to long
reshape long DATE DEMO1 Q_2_S DEMO2 DEMO3_O1 DEMO3_O2 DEMO3_O3 DEMO3_O4 DEMO3_O5 DEMO3_O6 S_DEMO3_6 DEMO4 DEMO5 DEMO6 Q_7_S DEMO7 DEMO8 DEMO9 DEMO10 DEMO11 DEMO12 DEMO13 DEMO14 DEMO15_O1 DEMO15_O2 DEMO15_O3 DEMO15_O4 DEMO15_O5 DEMO15_O6 DEMO15_O7 DEMO15_O8 S_DEMO15_8 SHK1_O1 SHK1_O2 SHK1_O3 SHK1_O4 SHK1_O5 SHK2 SHK3 SHK4 SHK5 SHK6 SHK7 SHK8 GEI1 GEI2 GEI3 GEI4 GEI5 ESE1 ESE2 ESE3 ESE4 ESE5 ESE6 ESE7 ESE8 ESE9 ESE10 ESE11 ESE12 FL1 FL2 FL3 FL4 FL5 IGAI1 IGAI2 IGAI3 IGAI4 IGAI5 , i(ID) j(month, string)


/*Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               49   ->   98          
Number of variables                 143   ->   73          
j variable (2 values)                     ->   month 
*/

***duplicates report ID
duplicates report ID //49 unique persons completed the survey at least once

*two participants have an ID but no other information for month 0, drop these
drop if DATE==. & month=="_M0" //ID: 232 (has month 4 data) ID: 216 (has month 4 data)

*create var to indicate if they completed survey at baseline
gen srvy_b = 1 if month=="_M0" & DATE!=.
replace srvy_b= 0 if month=="_M0" & srvy_b==.
tab srvy_b, mi 

*create var to indicate if they completed survey at followup
gen srvy_f = 1 if month=="_M4" & DATE!=.
replace srvy_f= 0 if month=="_M4" & srvy_f==.
tab srvy_f, mi 

*gen var for control or intervention arm
gen tx = 1 if ID>200
replace tx = 0 if ID < 200

tab tx srvy_b
tab tx srvy_f
tab tx month, mi
tab srvy_b srvy_f, mi
gen srvy_c = 1 if DATE !=.
replace srvy_c = 0 if DATE ==.
tab srvy_c month //47 completed baseline survey, 22 completed endline survey
bysort tx: tab srvy_c month
bysort tx: tab srvy_c 
bysort tx: tab month

quietly bysort ID:  gen dup = cond(_N==1,0,_n)
list ID if dup==0

/*
     +-----+
     |  ID |
     |-----|
 67. | 216 |
 96. | 232 |
     +-----+

*/



*label vars
	label var DEMO1 "Gender"
	capture label define demo1 1 "Male"  2 "Female" 3 "Other"
	label values DEMO1 demo1
	
	label var DEMO2 "Age at enrollment"

	label var DEMO3_O1 "Ethnicity"
	capture label define demo3 1 "Indigenous"  2 "Mixed" 3 "Afro-Ecuadorian/Black" 4 "White" 5 "Don't know/Don't want to answer" 6 "Other"
	label values DEMO3_O1 demo3

	label var DEMO4 "Material of outside walls of house"
	capture label define demo4 1 "Concrete"  2 "Brick or block" 3 "Adobe / Tapia" 4 "Coated cane or bambood / wood" 5 "Uncoated cane / other materials"
	label values DEMO4 demo4
	
	label var DEMO5 "Internet service in home"
	capture label define demo5 1 "No"  2 "Yes"
	label values DEMO5 demo5
	
	label var DEMO6 "Sexual orientation"
	capture label define demo6 1 "Straight/Heterosexual"  2 "Gay/lesbian/homosexual" 3 "Bisexual" 4 "Pansexual" 5 "don't understand what this question means" 6 "Other"
	label values DEMO6 demo6
	
*gen table 1 descriptive stats
preserve
keep if month=="_M0"
table1_mc, by(tx) ///
			vars (DEMO1 cat \ ///
			DEMO2 contn %4.2f \ ///
			DEMO3_O1 cat \ ///
			DEMO4 cat \ ///
			DEMO5 cat \ ///
			DEMO6 cat \ ///
			DEMO7 cat ) nospace percent_n onecol missing total(before) test 
			
restore	


*****Generate summary variables needed for preliminary effectiveness analysis. In project protocol, these were:
/*
4-month change in self-reported condom use at first sex and/or last sex
4-month change in self-reported (non-condom) modern contraception use
4-month change in self-reported frequency of sexual encounters
4-month change in self-reported number of sexual partners
4-month change in entrepreneurial self-efficacy
4-month change in financial literacy 
4-month change in sexual health knowledge index
4-month change in gender empowerment index
4-month change in income-generating ability index
*/

label var DEMO9 "Did you use a condom with your most recent sexual partner?"
label var DEMO13 "In the last 4 months, how frequently did you use condoms during sex?"
label var DEMO14 "In the last 4 months, how frequently did you use a contraception method other than condoms to prevent pregnancy or sexually transmitted infections during sex?"

***gen Sexual Health Knowledge Index***
*Bandera O et al. instructions: The HIV knowledge index is based on the number of statements correctly identified as true or false.

*step 1: create intermediary vars that are binary for correct (1) or incorrect (0)
gen SHK1i=1 if SHK1_O1==4 & SHK1_O2==-1 & SHK1_O3==-1 & SHK1_O4==-1
replace SHK1i=0 if SHK1_O1!=4 & DATE !=.

gen SHK2i=1 if SHK2==3 
replace SHK2i=0 if SHK2!=3 & DATE !=.

gen SHK3i=1 if SHK3==1
replace SHK3i=0 if SHK3!=1 & DATE !=.

gen SHK4i=1 if SHK4==2
replace SHK4i=0 if SHK4!=2 & DATE !=.

gen SHK5i=1 if SHK5==1
replace SHK5i=0 if SHK5!=1 & DATE !=.

gen SHK6i=1 if SHK6==4
replace SHK6i=0 if SHK6!=4 & DATE !=.

gen SHK7i=1 if SHK7==1
replace SHK7i=0 if SHK7!=1 & DATE !=.

gen SHK8i=1 if SHK8==1
replace SHK8i=0 if SHK8!=1 & DATE !=.

*step 2: sum the number of items answered correctly (for which intermediary variable==1) to generate the total index
egen SHK_index = rowtotal(SHK1i-SHK8i)
egen miss_count = rowmiss(SHK1i-SHK8i)
replace SHK_index=. if miss_count==8
drop miss_count
sum SHK_index, d //range of 0 to 7 is within the min/max range of 0 to 8
bysort month: sum SHK_index // mean is 2.93 at month 0 and 4.3 at month 4, slight improvement but this is for all respondents at baseline

preserve
keep if tx==1
bysort month: sum SHK_index //2.97 to 4.3 
restore


***gen Income Generating Activities Index***
//IGA1-IGA5
//follow instructions by Kling: https://users.nber.org/~kling/mto_exp_a.pdf
describe IGAI1-IGAI5
sum IGAI1-IGAI5

**Summary index is the mean of normalized values of component items.
*step 1. replace -1 values with missing
foreach var of varlist IGAI2-IGAI5{
replace `var'=. if `var'==-1
}

*step 2. normalize each IGA item
sum IGAI1 if tx==0 //0.86, 0.93; 
return list
gen IGAI1_meanc = r(mean) 
gen IGAI1_stdc = r(sd)

gen IGAI1_z = (IGAI1-IGAI1_meanc)/IGAI1_stdc

foreach var of varlist IGAI2-IGAI5{
sum `var' if tx==0 
return list
gen `var'_meanc = r(mean) 
gen `var'_stdc = r(sd)
gen `var'_z = (`var'-`var'_meanc)/`var'_stdc
}

*step 3. average the normalized transformations for each outcome
egen IGA_Index= rowmean(IGAI1_z IGAI2_z IGAI3_z IGAI4_z IGAI5_z)
bysort tx: sum IGA_Index
bysort month: sum IGA_Index if tx==1 //-0.03 at month 0 and 0.07 at month 4
preserve
keep if tx==1
ttest IGA_Index, by(month) //p==0.59
restore



***gen Entrepreneurial Self-Efficacy Index***
*Following Ho M et al. Froniters 2018 instructions: take the mean scores across the items. Higher mean composite scores indicated higher entrepreneurial efficacy
codebook ESE1-ESE12
foreach var of varlist ESE1-ESE12{
replace `var'=. if `var'==-1
}

egen ese_average = rowmean (ESE1-ESE12)
bysort month: sum ese_average if tx==1 
preserve
keep if tx==1
ttest ese_average, by(month) //p==0.09
restore

***gen financial literacy summary score
*Following instructions from: (1) OECD INFE. (2011). Measuring Financial Literacy: Core Questionnaire in Measuring Financial Literacy: Questionnaire and Guidance Notes for conducting an Internationally Comparable Survey of Financial literacy. Paris: OECD. https://www.oecd.org/finance/financial-education/49319977.pdf; and (2) OECD (2022, OECD/INFE Toolkit for Measuring Financial Literacy and Financial Inclusion 2022, http://www.oecd.org/financial/education/2022-INFE-Toolkit-Measuring-Finlit-Financial-Inclusion.pdf. 

gen fl1_correct = 1 if FL1>=166 & FL1<167
gen fl2_correct = 1 if FL2==102 & FL2!=.
gen fl3_correct = 1 if FL3==110 & FL3!=.
gen fl4_correct = 1 if FL4==1 & FL4!=.
gen fl5_correct = 1 if FL5==1 & FL5!=.

foreach var of varlist fl1_correct-fl5_correct{
replace `var'=0 if `var'!=1
}

egen fl_index = rowtotal(fl1_correct-fl5_correct)

***gen gender empowerment index
gen GEI1_correct = 1 if GEI1==3
gen GEI2_correct = 1 if GEI2==3
gen GEI3_correct = 1 if GEI3==3
gen GEI4_correct = 1 if GEI4==3
gen GEI5_correct = 1 if GEI5==3

foreach var of varlist GEI1_correct-GEI5_correct{
replace `var'=0 if `var'!=1
}

egen gei_total = rowtotal(GEI1_correct-GEI5_correct)

gen ge_index = (gei_total / 5) * 100



***Table 1 of demographic and socioeconomic characteristics 

label var DEMO1 "Gender"
label var DEMO2 "Age at enrollment"
label var DEMO3_O1 "Race_1"
label var DEMO4 "House wall material"
label var DEMO5 "Internent in the home"
label var DEMO6 "Sexual orientation"
label var DEMO7 "Have you ever had sexual intercourse (vaginal or anal)"

replace DEMO6 = . if DEMO6==-1

foreach var of varlist DEMO7 DEMO9 DEMO12 DEMO13 DEMO14 {
	replace `var' = . if `var'==-1
}
preserve
drop if month =="_M4"
table1_mc, by(tx) vars ( ///
				DEMO1 cat %4.1f \ ///
				DEMO2 contn %4.1f \ ///
				DEMO3_O1 cat %4.1f \ /// 
				DEMO4 cat %4.1f \ ///
				DEMO5 cat %4.1f \ ///
				DEMO6 cat %4.1f \ /// p value here is 0.004
				DEMO7 cat %4.1f ) nospace percent_n onecol missing total(before)
restore

***Table 2. Median total scores on outcome measures among adolescent patients with (Month 4) and without (Month 0) exposure to the group intervention

//look at correlation between outcomes
pwcorr DEMO9 DEMO12 fl_index IGA_Index ese_average ge_index SHK_index, sig star(.05) obs bon // positive correlation between gender empowerment index and financial literacy 

//can we assume dependent variables are normally distributed?
mvtest normality DEMO9 DEMO12 fl_index IGA_Index ese_average ge_index SHK_index tx, bivariate univariate stats(all) 
 * DEMO09 DEMO12 and ge_index are not normally distributed 
 * Of the four multivariate normality tests, all test rejects the null hypothesis of multivariate normality

//reverse code DEMO9 so that higher value indicates better/more frequent condom use with most recent partner
gen DEMO9_rec = 1 if DEMO9==3
replace DEMO9_rec = 2 if DEMO9==2
replace DEMO9_rec = 3 if DEMO9==1

//reverse code DEMO13 so that higher value indicates better/more frequent condom use with most recent partner
gen DEMO13_rec = 1 if DEMO13==5
replace DEMO13_rec = 2 if DEMO13==4
replace DEMO13_rec = 3 if DEMO13==3
replace DEMO13_rec = 4 if DEMO13==2
replace DEMO13_rec = 5  if DEMO12==1

label var DEMO12 "How many sexual partners did you have in the last 4 months?"
label var DEMO13 "In the last 4 months, how frequently did you use condoms during sex?"
label var DEMO13_rec "In the last 4 months, how frequently did you use condoms during sex? (recoded)"
label var DEMO9 "Did you use a condom with your most recent sexual partner?"
label var DEMO9_rec "Did you use a condom with your most recent sexual partner? (recoded)"
label var DEMO7 "Have you ever had sex with vaginal or anal penetration?"

//Table 2 and One-way manova model presented in paper 
preserve 
tab tx month //29 tx at month 0
sort tx month
drop if tx==1 & month=="_M0" //29 obs deleted so that we are comparing control scores at month 0 to intervention scores at month 4
drop if tx==0 & month=="_M4" 
tab tx month
drop if ID==216 //completed survey at m4 but not at m0
drop if ID==232 //completed survey at m4 but not at m0
/*
     +-----+
     |  ID |
     |-----|
 67. | 216 |
 96. | 232 |
     +-----+

*/

		table1_mc, 	by(tx) 							/// 
			vars(		DEMO9_rec conts %4.2f \	///
						DEMO12 conts %4.2f \ ///
						DEMO13_rec conts %4.2f \ ///
						fl_index conts %4.2f \		///
						IGA_Index conts %4.2f \	///
						ese_average conts %4.2f \	///
						ge_index conts %4.2f \	///
						SHK_index conts %4.2f)  nospace onecol missing test total(before) saving("$outputdir\table 2.xlsx", replace)		

manova DEMO9_rec fl_index IGA_Index ese_average ge_index SHK_index = i.tx  //<-- report in paper text but not in table
mvreg
restore

//Table 2 using mean instead of medians
preserve 
tab tx month //29 tx at month 0
sort tx month
drop if tx==1 & month=="_M0" //29 obs deleted so that we are comparing control scores at month 0 to intervention scores at month 4
drop if tx==0 & month=="_M4" 
drop if ID==216 //completed survey at m4 but not at m0
drop if ID==232 //completed survey at m4 but not at m0
/*
     +-----+
     |  ID |
     |-----|
 67. | 216 |
 96. | 232 |
     +-----+

*/
tab tx month

		table1_mc, 	by(tx) 							/// 
			vars(		DEMO9_rec contn %4.2f \	///
						DEMO12 contn %4.2f \ ///
						DEMO13_rec contn %4.2f \ ///
						fl_index contn %4.2f \		///
						IGA_Index contn %4.2f \	///
						ese_average contn %4.2f \	///
						ge_index contn %4.2f \	///
						SHK_index contn %4.2f)  nospace onecol missing test total(before) saving("$outputdir\table 2_appendix.xlsx", replace)	


restore

****Run linear regression for each of our outcomes****
gen time = 0 if month=="_M0"
replace time = 1 if month=="_M4"


**define global covariate vector
	*demographic data were only recorded at month 0, assume they are the same at month 4 as well
		*fill down the covariates at enrollment	
		sort time ID
		bysort ID: carryforward DEMO1, gen(gender)
		bysort ID: carryforward DEMO2, gen(age)
		bysort ID: carryforward DEMO3_O1, gen(race)
		bysort ID: carryforward DEMO4, gen(house)
		bysort ID: carryforward DEMO5, gen(internet)
		bysort ID: carryforward DEMO6, gen(sorien)
		
		gen male = 1 if gender ==1
		replace male = 0 if male==.
		
		gen indigenous = 1 if DEMO3_O1 == 1
		replace indigenous = 0 if indigenous==.
		
		gen mixed = 1 if DEMO3_O1 == 2
		replace mixed = 0 if mixed==.
		
		gen afro = 1 if DEMO3_O1 == 3
		replace afro = 0 if afro==.
		
		gen brick = 1 if house== 2
		replace brick = 0 if brick==.
		gen concrete = 1 if house==1
		replace concrete = 0 if concrete==. 
		gen adobe = 1 if house==3
		replace adobe = 0 if adobe ==.
		
		gen internet_y = 1 if internet== 2
		replace internet_y = 0 if internet_y==.
		
		gen straight = 1 if sorien==1
		replace straight = 0 if straight==.
	
	global xlist male indigenous mixed afro brick concrete adobe internet_y straight

	gen indigenous_rev = 1 if race==1
	replace indigenous_rev = 0 if indigenous_rev==.
	global xlist male indigenous_rev brick internet_y

*gen var to indicate which afterschool club particpant was assigned to, in order to cluster by group
gen group = 1 if ID >200 & ID <=212
replace group = 1 if ID ==230

replace group = 2 if ID >212 & ID <=229
replace group = 2 if ID ==231
replace group = 2 if ID ==232

distinct ID if group ==1 //13
distinct ID if group ==2 //18; in attendance record from Allpa ID 228 is in Group B but ID 228 is not in the dataset


*declare panel data
xtset ID time 
xtdescribe //47 records have data at 2 time points, 2 records only have data at month 4, we dont include these in the regression

*doesn't make sense to do panel data analysis, since tx=0 only has baseline data
*so we keep tx=0 and time==0, and tx==1 and time==1

preserve 
drop if tx==0 & time==1 //18 blank observations dropped
drop if tx==1 & time==0 //29 observations dropped
drop if srvy_c == 0 //drop 9 intervention participants who didnt complete survey at endline (i.e., complete case analysis)

*Entrepreneurial Self-Efficacy Index
reg ese_average tx, vce(cluster group) //collinearity
reg ese_average tx $xlist, vce(cluster group) //collinearity

reg ese_average tx, vce(robust) 
reg ese_average tx $xlist, vce(robust)
estimates store m1
estat ic

*Income Generating Ability Index 
reg IGA_Index tx, vce(cluster group) //collinearity
reg IGA_Index tx $xlist, vce(cluster group) //collinearity

reg IGA_Index tx, vce(robust) 
reg IGA_Index tx $xlist, vce(robust) 
estimates store m2
estat ic

*Financial Literacy Index 
reg fl_index tx, vce(cluster group) //collinearity
reg fl_index tx $xlist, vce(cluster group) //collinearity

reg fl_index tx, vce(robust) 
reg fl_index tx $xlist, vce(robust) 
estimates store m3
estat ic

*Gender Empowerment Index 
reg ge_index tx, vce(cluster group) //collinearity
reg ge_index tx $xlist, vce(cluster group) //collinearity

reg ge_index tx, vce(robust) 
reg ge_index tx $xlist, vce(robust) 
estimates store m4
estat ic 

*Sexual health knowledge Index
*Gender Empowerment Index 
reg SHK_index tx, vce(cluster group) //collinearity
reg SHK_index  tx $xlist, vce(cluster group) //collinearity

reg SHK_index tx, vce(robust) 
reg SHK_index tx $xlist, vce(robust) 
estimates store m5
estat ic

*frequency of any contraception method in last 4 months
gen contraception_y = 5 if DEMO13 ==1
replace contraception_y = 4 if DEMO13 ==2
replace contraception_y = 3 if DEMO13 ==3
replace contraception_y = 2 if DEMO13 ==4
replace contraception_y = 1 if DEMO13 ==5

replace contraception_y = 5 if DEMO14 ==1 & contraception_y==.
replace contraception_y = 4 if DEMO14 ==2 & contraception_y==.
replace contraception_y = 3 if DEMO14 ==3 & contraception_y==.
replace contraception_y = 2 if DEMO14 ==4 & contraception_y==.
replace contraception_y = 1 if DEMO14 ==5 & contraception_y==.

replace contraception_y = 5 if ID==101

reg contraception_y tx, vce(cluster group) //collinearity
reg contraception_y  tx $xlist, vce(cluster group) //collinearity

reg contraception_y tx, vce(robust) 
reg contraception_y tx $xlist, vce(robust) 

*binary condom use 
gen condom = 1 if DEMO9==2
replace condom = 0 if condom ==.
logit condom tx $xlist, vce(robust) or

*binary ever sex
gen ever_sex = 1 if DEMO7==2
replace ever_sex = 0 if ever_sex ==.
logit ever_sex tx $xlist, vce(robust) or
estimate store m6
estat ic

estout m1 m2 m3 m4 m5 m6, cells(b(star fmt(3)) se(par fmt(4))) starl( * 0.10 ** 0.05 *** 0.010) legend label varlabels(_cons Control Mean)
esttab m1 m2 m3 m4 m5 m6 using "$outputdir\table 3.csv", replace se starl( * 0.10 ** 0.05 *** 0.010) varwidth(25) title(Table 3: Adjusted regression results on key outcomes) addnote("Robust SE clustered at the individual level; m1 - m5 present beta coefficients, m6 presents Odds Ratio ") legend varlabels(_cons Control Mean) 

restore





clear
log close











